package sigmacinema.entity;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.Cascade;

@Entity
@Table(name="TB_BookingHeader")
public class BookingHeader {
	@Id
	@Column(name="booking_id", length=10, nullable=false)
	private String bookingID;
	
	@Column(name="booking_date", nullable=false)
    @Temporal(TemporalType.TIMESTAMP)
    private Date bookingDate;
	
	@ManyToOne
    @JoinColumn(name="cust_id")
	private Customer customer;
	
	@Column(name="total")
	private BigDecimal priceTotal;
	
	@OneToMany(mappedBy="bookingHeader")
	@Cascade(value=org.hibernate.annotations.CascadeType.ALL)
	private List<BookingDetail> BookingDetail;

	public String getBookingID() {
		return bookingID;
	}

	public void setBookingID(String bookingID) {
		this.bookingID = bookingID;
	}

	public Date getBookingDate() {
		return bookingDate;
	}

	public void setBookingDate(Date bookingDate) {
		this.bookingDate = bookingDate;
	}

	public Customer getCustomer() {
		return customer;
	}

	public void setCustomer(Customer customer) {
		this.customer = customer;
	}

	public BigDecimal getPriceTotal() {
		return priceTotal;
	}

	public void setPriceTotal(BigDecimal priceTotal) {
		this.priceTotal = priceTotal;
	}

	public List<BookingDetail> getBookingDetail() {
		return BookingDetail;
	}

	public void setBookingDetail(List<BookingDetail> bookingDetail) {
		BookingDetail = bookingDetail;
	}
	
}
